(function () {
function applyFix() {
// Run ONLY on product page
if (!document.body.classList.contains('template-product')) return;
const container = document.querySelector('.buttons');
const target = document.querySelector('.product-main .product-details .single-product-meta');
if (!container || !target) return;
// Remove unwanted buttons
const hide = container.querySelector('.hide_text');
const show = container.querySelector('.showtext');
if (hide) hide.remove();
if (show) show.remove();
// Always move after correct element
if (target.nextElementSibling !== container) {
target.parentNode.insertBefore(container, target.nextSibling);
}
// Force horizontal layout (VERY IMPORTANT)
container.style.cssText = `
display:flex !important;
flex-direction:row !important;
align-items:center !important;
gap:10px !important;
margin-top:12px !important;
padding:8px 12px !important;
background:#0a87da !important;
border-radius:6px !important;
width:fit-content !important;
flex-wrap:nowrap !important;
`;
// Button styling
container.querySelectorAll('button').forEach(btn => {
btn.style.cssText = `
display:flex !important;
align-items:center;
justify-content:center;
background:transparent;
border:none;
cursor:pointer;
padding:5px;
color:#fff;
`;
});
// Icon size
container.querySelectorAll('svg').forEach(svg => {
svg.style.width = "16px";
svg.style.height = "16px";
});
// Hide qetext ALWAYS
const qe = document.querySelector('#qetext');
if (qe) {
qe.style.cssText = "display:none !important;";
}
// Close button
const close = container.querySelector('.close_sbutton');
if (close && !close.dataset.done) {
close.onclick = () => container.style.display = "none";
close.dataset.done = "1";
}
// Block play popup
const play = container.querySelector('#play');
if (play && !play.dataset.done) {
play.addEventListener('click', function (e) {
e.stopImmediatePropagation();
e.preventDefault();
const qe = document.querySelector('#qetext');
if (qe) {
qe.style.setProperty('display', 'none', 'important');
qe.style.visibility = "hidden";
qe.style.opacity = "0";
}
return false;
}, true);
play.dataset.done = "1";
}
}
let count = 0;
const interval = setInterval(() => {
applyFix();
if (++count > 40) clearInterval(interval);
}, 250);
const observer = new MutationObserver(() => applyFix());
observer.observe(document.body, { childList: true, subtree: true });
})();
.template-index #start_button,
.template-collection #start_button,
.template-product #start_button,
body.template-index .buttons {
display: none !important;
}
.template-collection .buttons,
.template-product .buttons {
display: none !important;
}